package org.example.threadlocal;

public class MyThreadLocal {

    public static void main(String[] args) {
        ThreadLocal<String> threadLocal = new ThreadLocal<>();
        threadLocal.set("1234");
        threadLocal.get();
        TestThread thread1 = new TestThread();
        thread1.setThreadLocal(threadLocal);
        thread1.setThreadLocalParam("thread1");
        TestThread thread2 = new TestThread();
        thread2.setThreadLocal(threadLocal);
        thread2.setThreadLocalParam("thread2");
        thread1.start();
        thread2.start();
    }
}
